<div id="histtable">
  <%= form_tag({:controller => 'articles', :action => 'diff',
                :project_id => @project, :id => @article.id},
                :method => :get) do %>
  <table class="list wiki-page-versions">
  <thead><tr>
      <th><%= l(:field_version) %></th>
      <th></th>
      <th></th>
      <th><%= l(:field_updated_at) %></th>
      <th><%= l(:field_article_updater) %></th>
      <th><%= l(:field_version_comments) %></th>
  </tr></thead>
  <tbody>
  <% show_diff = @article.versions.size > 1 %>
  <% line_num = 1 %>
  <% @article.versions.reverse.each do |ver| %>
  <tr class="wiki-page-version <%= cycle("odd", "even") %>">
      <td class="id"><%=h @article.version == ver.version ? l(:text_current_version) : link_to((ver.version), {:action => 'version', :kb_article_id => @article.id, :version => ver.version}) %></td>
      <td class="checkbox"><%= radio_button_tag('version', ver.version, (line_num==1), :id => "cb-#{line_num}", :onclick => "$('#cbto-#{line_num+1}').attr('checked', true);") if show_diff && (line_num < @versions.size) %></td>
      <td class="checkbox"><%= radio_button_tag('version_from', ver.version, (line_num==2), :id => "cbto-#{line_num}") if show_diff && (line_num > 1) %></td>
      <td class="updated_at"><%= format_time(ver.updated_at) %></td>
      <td class="author"><%= ver.updater ? link_to_user(ver.updater) : link_to_user(ver.author) %></td>
      <td class="comments"><%=h ver.version_comments %></td>
  </tr>
  <% line_num += 1 %>
  <% end %>
  </tbody>
  </table>
  <%= submit_tag l(:label_view_diff), :class => 'small' if show_diff %>
  <% end %>
</div>